package com.web.admin.global.model;

import com.blue.core.dict.Auth;
import com.web.base.user.message.UserResponse;
import com.web.core.dict.UserRole;

import java.util.Date;

public class User
{
	private Integer id; // 编号
	private String name; // 用户名
	private String password; // 密码
	private String mobile; // 手机
	private String wxUnionId; // 微信UnionId
	private String nickname; // 用户昵称
	private String pic; // 用户头像
	private String email; // 邮箱
	private Date createTime; // 创建时间
	private Date loginTime; // 登录时间
	private UserRole role; // 用户角色
	private Auth auth; // 审核状态

	public User()
	{
	}
	
	public static User toUser(UserResponse response)
	{
		if (response == null)
			return null;
		
		User user = new User();
		user.setId(response.getId());
		user.setName(response.getName());
		user.setPassword(response.getPassword());
		user.setMobile(response.getMobile());
		user.setWxUnionId(response.getWxUnionId());
		user.setNickname(response.getNickname());
		user.setPic(response.getPic());
		user.setEmail(response.getEmail());
		user.setCreateTime(response.getCreateTime());
		user.setLoginTime(response.getLoginTime());
		user.setRole(response.getRole());
		user.setAuth(response.getAuth());
		return user;
	}

	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public String getMobile()
	{
		return mobile;
	}

	public void setMobile(String mobile)
	{
		this.mobile = mobile;
	}

	public String getWxUnionId()
	{
		return wxUnionId;
	}

	public void setWxUnionId(String wxUnionId)
	{
		this.wxUnionId = wxUnionId;
	}

	public String getNickname()
	{
		return nickname;
	}

	public void setNickname(String nickname)
	{
		this.nickname = nickname;
	}

	public String getPic()
	{
		return pic;
	}

	public void setPic(String pic)
	{
		this.pic = pic;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getLoginTime()
	{
		return loginTime;
	}

	public void setLoginTime(Date loginTime)
	{
		this.loginTime = loginTime;
	}

	public UserRole getRole()
	{
		return role;
	}

	public void setRole(UserRole role)
	{
		this.role = role;
	}

	public Auth getAuth()
	{
		return auth;
	}

	public void setAuth(Auth auth)
	{
		this.auth = auth;
	}

}
